<include file="public/layout" />
<body style="background-color: #FFF; overflow: auto;">
<LZZ>
<load href="__ROOT__/public/plugins/Ueditor/ueditor.config.js"/>
<load href="__ROOT__/public/plugins/Ueditor/ueditor.all.min.js"/>
    
</LZZ>
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>门店管理 - 编辑门店</h3>
                <h5>网站系统门店管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="suppliersHandle" action="{:U('Supplier.Supplier/supplierHandle')}" enctype="multipart/form-data" method="post">
        <input type="hidden" name="act" value="{$act}">
        <input type="hidden" name="suppliers_id" value="{$info.suppliers_id}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="account"><em>*</em>门店账号</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="account" value="{$info.account}" id="account" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">门店账号</p>
                </dd>
            </dl>
            <notempty name="$type_info">
                <dl class="row">
                    <dt class="tit">
                        <label for="record_no">门店分类</label>
                    </dt>
                    <dd class="opt">
                        <div id="type_info">
                            <select name="type_id" id="type_info"  class="class-select valid">
                                <option value="0">选择门店分类</option>
                                <foreach name="type_info" item="v" >                                            
                                    <option value="{$v[type_id]}" <if condition="$v['type_id'] eq $info['type_id']">selected="selected"</if>>{$v[name]}</option>
                                </foreach>  
                            </select>                      
                        </div>
                        <p class="notic">添加后，即为身份产品</p>
                    </dd>
                </dl>   
            </notempty>  
            <dl class="row">
                <dt class="tit">
                    <label for="password"><em>*</em>门店密码</label>
                </dt>
                <dd class="opt">
                    <input type="password" name="password" value="{$info.password}" id="password" class="input-txt">
                    <input type="hidden" name="newpwd" value="{$info.password}">
                    <span class="err"></span>
                    <p class="notic">门店密码</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_name"><em>*</em>门店名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_name" value="{$info.suppliers_name}" id="suppliers_name" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">门店名称</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_name"><em>*</em>门店照片</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show">
                        <span class="show">
                            <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="{$info.suppliers_img}">
                              <i id="img_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src={$info.suppliers_img}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
                        <span class="type-file-box">
                            <input type="text" id="suppliers_img" name="suppliers_img" value="{$info.suppliers_img}" class="type-file-text">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" onClick="GetUploadify(1,'','suppliers','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                  </div>
                  <span class="err"></span>
                  <p class="notic">请上传图片格式文件,建议图片尺寸{$Request.param.suggestion}(宽*高, 如果不按要求上传图片将会导致前端广告显示不友好)</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_name"><em>*</em>门店直营</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="suppliers_directly" class="cb-enable <if condition="$info['is_directly'] eq 1">selected</if>">是</label>
                        <label for="suppliers_directly0" class="cb-disable <if condition="$info['is_directly'] eq 0">selected</if>">否</label>
                        <input id="suppliers_directly" name="is_directly" value="1" type="radio" <if condition="$info['is_directly'] eq 1"> checked="checked"</if>>
                        <input id="suppliers_directly0" name="is_directly" value="0" type="radio" <if condition="$info['is_directly'] eq 0"> checked="checked"</if>>
                    </div>
                    <p class="notic">例:服务时间：周一至周日 10:00-18:30</p>
                </dd>
            </dl>            
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>门店地址</label>
                </dt>
                <dd class="opt">
                    <select name="province_id" id="province" onblur="get_city(this)">
                        <option value="0">请选择</option>
                        <volist name="province" id="p">
                            <option <if condition="$info['province_id'] eq $p['id']">selected</if>  value="{$p.id}">{$p.name}</option>
                        </volist>
                    </select>
                    <select name="city_id" id="city" onblur="get_area(this)">
                        <option  value="0">请选择</option>
                        <volist name="city" id="p">
                            <option <if condition="$info['city_id'] eq $p['id']">selected</if>  value="{$p.id}">{$p.name}</option>
                        </volist>
                    </select>
                    <select name="district_id" id="district">
                        <option  value="0">请选择</option>
                        <volist name="district" id="p">
                            <option <if condition="$info['district_id'] eq $p['id']">selected</if>  value="{$p.id}">{$p.name}</option>
                        </volist>
                    </select>
                    <p class="notic">自提点地址</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>详细地址</label>
                </dt>
                <dd class="opt">
                    <textarea name="address" id="address" placeholder="详细地址" class="tarea" rows="6">{$info.address}</textarea>
                    <p class="notic">详细地址</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_desc"><em>*</em>门店描述</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_desc" value="{$info.suppliers_desc}" id="suppliers_desc" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">例:服务时间：周一至周日 10:00-18:30</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_contacts"><em>*</em>门店联系人</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_contacts" value="{$info.suppliers_contacts}" id="suppliers_contacts" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">门店联系人</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_phone"><em>*</em>门店电话</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_phone" value="{$info.suppliers_phone}" id="suppliers_phone" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写手机号码,以便于短信接收订单信息</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label ><em>*</em>上午营业时间</label>
                </dt>
                <dd class="opt">

                    <input type="time" name="business_time[morning][start]" value="{$info['business_time']['morning']['start']}" >—<input type="time" name="business_time[morning][finish]"  value="{$info['business_time']['morning']['finish']}" >
                    <span class="err"></span>
                    <p class="notic">请填写上午营业时间</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label ><em>*</em>下午营业时间</label>
                </dt>
                <dd class="opt">
                    <input type="time" name="business_time[afternoon][start]" value="{$info['business_time']['afternoon']['start']}"  >—<input type="time" name="business_time[afternoon][finish]" value="{$info['business_time']['afternoon']['finish']}"  value="">
                    <span class="err"></span>
                    <p class="notic">请填写下午营业时间</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_phone"><em>*</em>晚上营业时间</label>
                </dt>
                <dd class="opt">
                    <input type="time" name="business_time[night][start]" value="{$info['business_time']['night']['start']}"  >—<input type="time" name="business_time[night][finish]"  value="{$info['business_time']['night']['finish']}" >
                    <span class="err"></span>
                    <p class="notic">请填写晚上营业时间/p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_content"><em>*</em>门店描述详情</label>
                </dt>
                <dd class="opt">
                    <textarea class="span12 ckeditor" id="suppliers_content" name="suppliers_content" title="">{$info.suppliers_content}</textarea>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>显示</label>
                </dt>
                <dd class="opt">
                    <div class="onoff">
                        <label for="suppliers_show1" class="cb-enable <if condition="$info[is_check] eq 1">selected</if>">是</label>
                        <label for="suppliers_show0" class="cb-disable <if condition="$info[is_check] eq 0">selected</if>">否</label>
                        <input id="suppliers_show1" name="is_check" value="1" type="radio" <if condition="$info[is_check] eq 1"> checked="checked"</if>>
                        <input id="suppliers_show0" name="is_check" value="0" type="radio" <if condition="$info[is_check] eq 0"> checked="checked"</if>>
                    </div>
                    <p class="notic"></p>
                </dd>
            </dl>   
            <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
     var ue = UE.getEditor('suppliers_content',{
         zIndex: 999,
         initialFrameWidth: "100%", //初化宽度
         initialFrameHeight: 300, //初化高度            
         focus: false, //初始化时，是否让编辑器获得焦点true或false
         maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
         pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
         autoHeightEnabled: true
     });


    function adsubmit(){
        if($('input[name=suppliers_name]').val() == ''){
            layer.msg('门店名称不能为空！', {icon: 2,time: 1000});   //alert('少年，用户名不能为空！');
            return false;
        }
        if($('input[name=suppliers_desc]').val() == ''){
            layer.msg('门店描述不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        if($('input[name=suppliers_contacts]').val() == ''){
            layer.msg('门店联系人不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        if($('input[name=suppliers_phone]').val() == ''){
            layer.msg('门店电话不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        $('#suppliersHandle').submit();
    }
     function img_call_back(fileurl_tmp)
     {
       $("#suppliers_img").val(fileurl_tmp);
       $("#img_a").attr('href', fileurl_tmp);
       $("#img_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
     }
</script>
</body>
